import hashlib


class BaseUtils:

    @staticmethod
    def md5(str):
        if not str:
            return None
        temp = str.encode()
        new_temp = temp[0:len(temp) - 1]
        m = hashlib.md5()
        m.update(new_temp)
        # 获取sign
        return m.hexdigest()
